package com.jishuo.nontax.view.controller;

import com.jishuo.base.bean.BaseResult;
import com.jishuo.base.bean.vo.UserVO;
import com.jishuo.nontax.bean.vo.IllegalactivityinfoVO;
import com.jishuo.nontax.bfc.service.IllegalactivityinfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * @auther dinggaofei
 * @Date 2023/3/30 9:00
 */
@Slf4j
@Controller
@RequestMapping(value = "/view/illegalactivity", name = "交警罚没")
public class IllegalactivityViewController {
    private String prefix = "view/";
    @Resource
    private IllegalactivityinfoService illegalactivityinfoService;

    @RequestMapping(value = {"illegalactivityview", "illegalactivityview/{page}"}, name = "化解国库柜面")
    public String index(@PathVariable(required = false) String page) {
        return prefix + ((page == null) ? "illegalactivityview" : page);
    }

    @ResponseBody
    @RequestMapping(value = "querystudentview", name = "交警罚没柜面")
    public BaseResult querystudentview(String billnum) {
        return illegalactivityinfoService.getIllegalactivityInfo(billnum);
    }

    @ResponseBody
    @RequestMapping(value = "illegalactivitypayview",name="交警罚没收款")
    public BaseResult illegalactivitypayview(IllegalactivityinfoVO vo, HttpSession session) {
        UserVO user = (UserVO) session.getAttribute("login_user");
        return illegalactivityinfoService.illegalactivitypayview(vo, user);
    }
}
